package com.hejia.alauda.persistence.mybatis;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import com.hejia.alauda.entity.PayGate;
import com.hejia.alauda.persistence.BaseMapper;

public interface PayGateMapper extends BaseMapper<PayGate> {

	@Select("select b.* from `order` a ,`paygate` b where str_to_date(a.createdate,'%Y-%m-%d')>=#{0} and #{1}>=str_to_date(a.createdate,'%Y-%m-%d') and a.`payGateCode`=b.gatecode GROUP BY b.id;")
	@ResultType(value = Map.class)
	public List<PayGate> payGateByDate(String startdate, String enddate);

	@Select("select b.* from `order` a ,`paygate` b where a.`payGateCode`=b.gatecode GROUP BY b.id;")
	@ResultType(value = Map.class)
	public List<PayGate> allPayGateByDate();
}
